import { RouteRecordRaw } from 'vue-router'
import Main from "@/components/main/index.vue";
import ParentPage from '@/components/parentPage/ParentPage.vue'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: 'home',
    name: 'Index',
    component: Main,
    meta:{
      title: '首页',
      lang: 'index',
      icon: 'el-icon-s-home'
    },
    children: [
      {
        path: '/home',
        name: 'Home',
        meta: {
          title: '欢迎首页',
          lang: 'home',
          icon: 'fa-home'
        },
        component: () => import('../views/home/Home.vue'),
      }
    ]
  },
  {
    path: '/page',
    name: 'Page',
    component: Main,
    meta:{
      title: '页面',
      lang: 'page',
      icon: 'el-icon-s-promotion'
    },
    children: [
      {
        path: '/form',
        name: 'From',
        meta: {
          title: '表单页面',
          lang: 'from',
          isDirectory: true,
          icon: 'el-icon-s-order'
        },
        component: ParentPage,
        children: [
          {
            path: '/basForm',
            name: 'BasFrom',
            meta: {
              title: '基础表单',
              lang: 'basFrom',
              icon: 'fa-wpforms'
            },
            component: () => import('@/views/pages/formPage/BasForm.vue')
          },{
            path: '/stepForm',
            name: 'StepFrom',
            meta: {
              title: '分步表单',
              lang: 'stepFrom',
              icon: 'fa-wpforms'
            },
            component: () => import('@/views/pages/formPage/StepForm.vue')
          }
        ]
      }
    ]
  },
]
export default routes
